Enable measures to return rich outputs (plots, HTML tables) - #113
Conversation
|
Preview deployed to Connect ( Deployed from commit a48ba1c. |
|
Preview deployed to Connect ( Deployed from commit a48ba1c. |
|
Thank you, @skaltman! I've made some changes here—the big item is removing the exported Could you install the new version of this PR and then take it for a spin in the TLG agent and let me know if it works for you? You might need to remove any calls to |
|
@simonpcouch thank you! The plot support works great. The Since this is just an example app, I don't think it's that big of a deal to convert them to I realize that |
|
I guess the approach that would allow us to reuse as much of what ellmer/shinychat give us as possible, and also an entry point to model-facing vs. user-facing display, is that measures could return table <- build_table(...)
ellmer::ContentToolResult(
value = rtables::as_result_df(table),
extra = list(
display = shinychat::tool_result_display(
html = rtables::as_html(table),
open = TRUE,
show_request = FALSE
)
data = table
)
)Then:
|
|
Ah, looks like tlg-agent depended on the old |
|
Just gave this a go in tlg-agent and it feels good to me! If you could, please take a look + take that for a spin and, if it works well for you, feel free to squash+merge here! |
|
It works great in tlg-agent! Just waiting for the checks to complete... |
|
Cleaned up 14 preview bundle(s) on https://dogfood.team.pct.posit.it: 361854, 361856, 361857, 361859, 361860, 362424, 362425, 362426, 362429, 362432, 362433, 362795, 362799, 362800 |
|
Cleaned up 14 preview bundle(s) on https://connect.staging.pct.posit.it: 1805, 1806, 1807, 1808, 1809, 1916, 1917, 1919, 1920, 1923, 1924, 1994, 1995, 1996 |
Addresses #56.
I mostly wanted to see what the TLG agent felt like with plots and gt tables supported as measure outputs, so I started working on this.
Totally fine if we want to go in a different direction for this.
Idea for more general solution from sol: